﻿// Decompiled with JetBrains decompiler
// Type: StoryMode.StoryModeManager
// Assembly: StoryMode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 11BAE65F-6C15-4628-A9C6-1B968588CDA1
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\Modules\StoryMode\bin\Win64_Shipping_Client\StoryMode.dll

using StoryMode.StoryModeObjects;
using System.Collections.Generic;
using TaleWorlds.Core;
using TaleWorlds.SaveSystem;

#nullable disable
namespace StoryMode
{
  public class StoryModeManager
  {
    internal static void AutoGeneratedStaticCollectObjectsStoryModeManager(
      object o,
      List<object> collectedObjects)
    {
      ((StoryModeManager) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected virtual void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      collectedObjects.Add((object) this.MainStoryLine);
    }

    internal static object AutoGeneratedGetMemberValueMainStoryLine(object o)
    {
      return (object) ((StoryModeManager) o).MainStoryLine;
    }

    public static StoryModeManager Current
    {
      get
      {
        return !(Game.Current?.GameType is CampaignStoryMode gameType) ? (StoryModeManager) null : gameType.StoryMode;
      }
    }

    public StoryModeEvents StoryModeEvents { get; private set; }

    [SaveableProperty(1)]
    public MainStoryLine MainStoryLine { get; private set; }

    public StoryModeHeroes StoryModeHeroes { get; private set; }

    public StoryModeBannerEffects StoryModeBannerEffects { get; private set; }

    public StoryModeManager()
    {
      this.Initialize();
      this.MainStoryLine = new MainStoryLine();
    }

    [LoadInitializationCallback]
    private void OnLoad(MetaData metaData) => this.Initialize();

    private void Initialize() => this.StoryModeEvents = new StoryModeEvents();

    internal void Destroy() => StoryModeData.OnGameEnd();

    internal void TickRealTime(float dt)
    {
    }

    internal void InitializeStoryModeObjects()
    {
      this.StoryModeHeroes = new StoryModeHeroes();
      this.StoryModeBannerEffects = new StoryModeBannerEffects();
    }
  }
}
